<template>
  <div class="reportExcel">
    <iFrame :src="iframeSrc"></iFrame>
  </div>
</template>
  
<script>
import iFrame from "@/components/iFrame"
export default {
  name: "reportList",
  components: { iFrame },
  data() {
    return {
      iframeSrc: "/electricScene/resources/templates/report/desreport/list.html"
    };
  },
  watch: {
    $route: {
      handler(n, o) {
        // console.log(n, o, window)
        if (n.query.hasOwnProperty('toPath')) {
          this.iframeSrc = "/electricScene/resources/templates/report/desreport/" + n.query.toPath + '?config_id=' + n.query.params
          for(let k in n.query) {
            if(k != 'toPath' && k != 'params') {
              this.iframeSrc += '&' + k + '=' + n.query[k]
            }
          }
        } else {
          this.iframeSrc = "/electricScene/resources/templates/report/desreport/list.html"
        }
      },
      deep: true,
      immediate: true
    }
  },
  created() {

  },
  mounted() {
    this.init();
  },
  methods: {
    init() { }
  }
};
</script>
  
<style scoped lang="scss">
.reportExcel {
  margin-top: -10px;
}
</style>
  
  